/*
 *  Copyright (C) 2009  Peter Kist & Jan Ripke
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __gfx_ogre3d_consumer_h
#define __gfx_ogre3d_consumer_h 1

#include <mediator/Consumer.h>

namespace galaxy {

    namespace mediator {
        class Event;
    }

    namespace gfx {
        namespace ogre3d {

            class Manager;

            class Consumer: public mediator::Consumer
            {
                static const char * c_ConsumerType;

                Manager * m_Manager;                    /**< naked pointer to manager */

                /** queue of events that must be processed by this consumer */
                core::ConcurrentList<mediator::EventPtr> events;    

                Consumer(void) { } /**< intentionally private default constructor */
            public:
                Consumer(Manager& manager);
                ~Consumer(void);

                // mediator::Consumer interface //
                virtual const char * consumerType () { return c_ConsumerType; };
                virtual void handleEvent (mediator::Event& event);
                virtual bool handleQueuedEvent (mediator::Event& event);

                // Consumer interface //
                void handleSingleEvent (mediator::Event& event);
                void handleKeyRelease (mediator::Event& event);
                void handleMouseEvent (mediator::Event& event);
                void handleMenuEvent (mediator::Event& event);
            };

        } // namespace ogre3d
    } // namespace gfx
} // namespace galaxy

#endif // __gfx_ogre3d_consumer_h
